package _22作业.IO流;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Scanner;

public class T7 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("D:\\黑马java培训班\\代码\\itcast\\JavaSE\\day10\\abd\\stu.txt");
        Scanner sc = new Scanner(System.in);
        while (true){
            System.out.println("请输入学生学号-姓名");
            String s = sc.nextLine();
            if ("end".equals(s)){
                return;
            }
            byte[] bytes = s.getBytes();
            fos.write(bytes);
            fos.write("\r\n".getBytes());
            fos.flush();
        }
        
    }
}
